package General;
import Card.Card;
import java.util.ArrayList;


public class Hand {
	//hands are 4,5,6,7
	private int handSize;
	private ArrayList<Card> handContents= new ArrayList<Card>();	
		//Changed from Card[]
		//Extra ease of deletion insertion, max size 7 so who cares about iteration costs 
	
	public Hand(){
		//construct hand to be size 4
		handSize =4;
	}
	public void setSize(int size){
		handSize = size;
	}
	public boolean insertCard(Card card){
		if(handContents.size()>=handSize) return false;	//fail condition, no space in hand
		handContents.add(card);
		return true;	//success cards successfully pushed
	}
	public Card getCard(int idx){
		//retrieves card from specified index
		if(handContents.size()>idx){
			return handContents.get(idx);			
		}
		else return null;
	}
	public boolean deleteCard(int idx){
		if(handContents.size()>idx){
			handContents.remove(idx);
			return true;
		}
		else return false;
	}
	public int currentSize(){
		return handContents.size();
	}
}
